'use strict';

/**
 * @ngInject
 */
function OnConfig($routeProvider, $locationProvider, $httpProvider) {
        //$locationProvider.html5Mode(true);

        $routeProvider.when('/', {
            templateUrl: 'main.html',
            controller: 'mainCtrl',
            page_title: '美比',
            header_left_button: 'profile',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/category/:cate', {
            templateUrl: 'items.html',
            controller: 'itemsCtrl',
            page_title: '商品列表',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/search/:keyword', {
            templateUrl: 'items.html',
            controller: 'searchCtrl',
            page_title: '商品列表',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/items/:itemID', {
            templateUrl: 'item.html',
            controller: 'itemCtrl',
            page_title: '商品详情',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/board/:boardID', {
            templateUrl: 'board.html',
            controller: 'boardCtrl',
            page_title: '专题详情',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/cart', {
            templateUrl: 'cart.html',
            controller: 'cartCtrl',
            page_title: '购物车',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: false,
        }).when('/checkout', {
            templateUrl: 'checkout.html',
            controller: 'checkoutCtrl',
            page_title: '结算',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: true,
        }).when('/address', {
            templateUrl: 'address.html',
            controller: 'addressCtrl',
            page_title: '选择地址',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: true,
        }).when('/address/list', {
            templateUrl: 'address_list.html',
            controller: 'addressCtrl',
            page_title: '列表地址',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: true,
        }).when('/address/add', {
            templateUrl: 'add_address.html',
            controller: 'addressFormCtrl',
            page_title: '添加地址',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: true,
        }).when('/address/edit/:addr_id', {
            templateUrl: 'add_address.html',
            controller: 'addressFormCtrl',
            page_title: '编辑地址',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: true,
        }).when('/login', {
            templateUrl: 'login.html',
            controller: 'loginCtrl',
            page_title: '登录',
            header_left_button: 'home',
            header_right_button: 'register',
            loginRequired: false,
        }).when('/fogotPW', {
            templateUrl: 'fogotPW.html',
            controller: 'fogotPWCtrl',
            page_title: '忘记密码',
            header_left_button: 'default',
            header_right_button: 'register',
            loginRequired: false,
        }).when('/logout', {
            controller: 'logoutCtrl',
        }).when('/account/oauth/:sitename', {
            templateUrl: 'oauth_success.html',
            controller: 'oauthCtrl',
        }).when('/payment/success', {
            templateUrl: 'payment_success.html',
            controller: 'paymentSuccessCtrl',
            header_left_button: 'home',
            header_right_button: 'blank',
        }).when('/payment/cancel', {
            templateUrl: 'payment_cancel.html',
            controller: 'paymentCancelCtrl',
            header_left_button: 'home',
            header_right_button: 'blank',
        }).when('/register', {
            templateUrl: 'register.html',
            controller: 'registerCtrl',
            page_title: '注册',
            header_left_button: 'default',
            header_right_button: 'default',
            loginRequired: false,
        }).when('/account', {
            templateUrl: 'personal_center.html',
            controller: 'accountCtrl',
            page_title: '个人中心',
            header_left_button: 'home',
            header_right_button: 'cart',
            loginRequired: true,
        }).when('/account/bind_email/:user_id', {
            templateUrl: 'bind_email.html',
            controller: 'bindEmailCtrl',
            page_title: '绑定邮箱',
            header_left_button: '',
            header_right_button: '',
        }).when('/orders', {
            templateUrl: 'orders.html',
            controller: 'ordersCtrl',
            page_title: '我的订单',
            header_left_button: 'home',
            header_right_button: 'cart',
            loginRequired: true,
        }).when('/order/:order_id', {
            templateUrl: 'order_detail.html',
            controller: 'orderDetailCtrl',
            page_title: '订单详情',
            header_left_button: 'default',
            header_right_button: 'profile',
            loginRequired: true,
        }).when('/order/logistics/:order_id', {
            templateUrl: 'logistics.html',
            controller: 'logisticsDetailCtrl',
            page_title: '物流详情',
            header_left_button: 'default',
            header_right_button: 'profile',
            loginRequired: true,
        }).when('/order/transfer/:order_id', {
            templateUrl: 'transfer_logistics.html',
            controller: 'logisticsDetailCtrl',
            page_title: '物流详情',
            header_left_button: 'default',
            header_right_button: 'profile',
            loginRequired: true,
        }).when('/express', {
            templateUrl: 'expressForm.html',
            controller: 'expressCtrl',
            page_title: '待寄物品清单',
            header_left_button: 'home',
            header_right_button: 'profile',
            loginRequired: false,
        }).when('/calculate', {
            templateUrl: 'calFee.html',
            controller: 'calculateCtrl',
            page_title: '运费估算',
            header_left_button: 'home',
            header_right_button: 'profile',
            loginRequired: false,
        }).when('/favors', {
            templateUrl: 'favors.html',
            controller: 'favorCtrl',
            page_title: '我的喜欢',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: true,
        }).when('/faq', {
            templateUrl: 'faq.html',
            controller: 'faqCtrl',
            page_title: '常见问题',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/limit', {
            templateUrl: 'limit.html',
            controller: 'faqCtrl',
            page_title: '邮寄限制',
            header_left_button: 'home',
            header_right_button: 'default',
            loginRequired: false,
        }).when('/customer-service', {
            templateUrl: 'cs.html',
            controller: 'csCtrl',
            page_title: '联系客服',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/feedback', {
            templateUrl: 'feedback.html',
            controller: 'feedbackCtrl',
            page_title: '意见反馈',
            header_left_button: 'default',
            header_right_button: 'cart',
            loginRequired: false,
        }).when('/fourZeroFour', {
            templateUrl: '404.html',
            controller: 'fourZeroFour_controller',
            page_title: '没找到',
            header_left_button: 'home',
            header_right_button: 'default',
            loginRequired: false,
        }).otherwise({
            redirectTo: '/fourZeroFour'
        });
        $httpProvider.defaults.headers.common['Cache-Control'] = 'no-cache';


    }
module.exports = OnConfig;
